import { View, Text } from '@tarojs/components'
import { useDidShow, useLoad } from '@tarojs/taro'
import styles from "./index.module.scss"
import Page from '@/components/Page'
import { useState } from 'react'
import Taro from '@tarojs/taro'
import { THEME } from '@/utils/theme'

export default function Index() {

  const [themeType, setThemeType] = useState<string>(Taro.getStorageSync('themeType') || 'normal')

  useDidShow(() => {
    setThemeType(Taro.getStorageSync('themeType') || 'normal')
  })

  return (
    <Page>
      <View style={THEME[themeType].styles}>
        <Text>Hello world!222</Text>
      </View>
    </Page>
  )
}
